<?php

namespace App\Http\Requests\Admin;

use App\Http\Controllers\Admin\AdminAuthController;
use App\Http\Requests\ApiRequest;
use Illuminate\Validation\Rule;

/**
 * @property string type
 * @property string id
 */
class GenerateTokenRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id'   => 'required|int',
            'type' => ['required', 'string', Rule::in([
                AdminAuthController::LOGIN_TYPE_CUSTOMER,
                AdminAuthController::LOGIN_TYPE_STORE,
            ])],
        ];
    }
}
